use core::ffi::c_void;
use core::ptr::null_mut;

use cmsis_rtos2::os_delay;
use cmsis_rtos2::os_kernel_get_tick_count;
use cmsis_rtos2::thread::Thread;

use cmsis_rtos2::osPriority_t_osPriorityHigh;
use cmsis_rtos2::osThreadDetached;
use log::info;

static mut TEST_TASK: Thread<1024, osThreadDetached, osPriority_t_osPriorityHigh> = Thread::const_new();

extern "C"
fn task_run(_: *mut c_void) {
    loop {
        info!("test_task: {}", os_kernel_get_tick_count());
        os_delay(300);
    }
}


pub fn start() {
    unsafe {
        TEST_TASK.start("test", task_run, null_mut());
    }
}




